
from zope.component import getUtility

import pydataportability.microformats.hcard
import pydataportability.microformats.xfn

from pydataportability.microformats.base.htmlparsers.etree import ElementTreeHTMLParser
from pydataportability.microformats.base.interfaces import IHTMLParser

import sys

parser = getUtility(IHTMLParser,name="beautifulsoup")()
mf = parser.fromURL(sys.argv[1])
mf.parse()

for name,result in mf.microformats.items():
    for r in result:
        print r

